package org.fujay.langchain4jserver.infrastructure.persistence.mybatis.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.fujay.mybatis.core.base.BaseEntity;

/**
 * 知识库持久化实体 (对应 knowledge_base 表)
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "knowledge_base")
public class KnowledgeBasePo extends BaseEntity {

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @TableField(value = "name")
    private String name;

    @TableField(value = "description")
    private String description;

    @TableField(value = "index_name")
    private String indexName;

    @TableField(value = "embedding_model_id")
    private Long embeddingModelId;

    @TableField(value = "namespace")
    private String namespace;

    /**
     * 对应 KnowledgeBaseStatus 枚举的 code 0: EMPTY, 1: INDEXING_PARTIAL, 2: INDEXING_COMPLETED, 3:
     * INDEXING_FAILED, 4: INDEXING_FULL, 5: NEEDS_REINDEX
     */
    @TableField(value = "status")
    private Integer status;

    @TableField(value = "document_count")
    private Integer documentCount; // 对应 DocumentCount.value

    @TableField(value = "del_flag")
    @TableLogic
    private Integer delFlag;
}
